package cn.tank.data.sync.core.common;

import java.util.UUID;

/************************************************
 * @Description:
 * @Version: 1.0
 ************************************************/
public abstract class Subscriber {

    /**
     * 订阅者id
     */
    private String id;

    /**
     * 订阅者名称
     */
    private String name;

    public Subscriber(String name) {
        this(UUID.randomUUID().toString(), name);
    }

    public Subscriber(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public String getId() {
        return this.id;
    }

    public String getName() {
        return this.name;
    }

    public abstract void write(String channel, Object entiry);

    public abstract void update(String channel, Object entiry);

    public abstract void delete(String channel, Object entiry);

    public abstract void refresh(String channel);
}
